﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MyStack<MemberType>
{
    private List<MemberType> m_list = new List<MemberType>();

    private MemberType m_return;

    public int Count
    {
        get
        {
            return m_list.Count;
        }
    }

    public MemberType Peek()
    {
        return m_list[m_list.Count - 1];
    }

    public MemberType Pop()
    {
        m_return = m_list[m_list.Count - 1];

        m_list.RemoveAt(m_list.Count - 1);

        return m_return;
    }

    public void Push(MemberType member)
    {
        m_list.Add(member);
    }

    public MemberType GetAt(int num)
    {
        return m_list[num];
    }

    public bool Contains(MemberType member)
    {
        return m_list.Contains(member);
    }
}
